function titleN() {
    let titName = document.getElementById("titleName").value;
    document.getElementById("t_name").innerText = titName;
}

function articleC() {
    let artCon = document.getElementById("articleCon").value;
    document.getElementById("a_content").innerHTML = artCon;

}

function chooseImg(e) {
    let img = document.getElementById("img1");
    console.log(e.src)
    document.getElementById("imagePat").value = e.src
    img.src = e.src
}

function selectImg(imageType) {
    console.log(imageType)
    let checked = document.getElementsByName("checked");
    let number = 0;
    let current = "";
    for (let i = 0; i < checked.length; i++) {
        if (checked[i].checked) {
            current = checked[i];
            number++;
        }
    }
    if (number > 1) {
        for (let i = 0; i < checked.length; i++) {
            checked[i].checked = false
        }
        alert("只可以选择一个数据");
    } else {
        let imageSelected = document.getElementById("image" + current.id);
        let homePath = document.getElementById(imageType);
        if (imageType == 'HomePat') {
            let img0 = document.getElementById("img0");
            img0.src = imageSelected.src;
        } else {
            let img1 = document.getElementById("img1");
            img1.src = imageSelected.src;
        }

        homePath.value = imageSelected.src;
        document.getElementById("imageShowDiv").style['display'] = "none";
    }

}

function showImagePage(imageType) {
    let b1 = document.getElementById('b_select');
    let b2 = document.getElementById('b_select1');
    if (imageType == "HomePat") {
        b2.style['display'] = 'none';
        b1.style['display'] = 'block';
    } else {
        b2.style['display'] = 'block';
        b1.style['display'] = 'none';

    }
    let imageShowDiv = document.getElementById("imageShowDiv");
    imageShowDiv.style['display'] = 'block';
}

function closeImagePage() {
    let imageShowDiv = document.getElementById("imageShowDiv");
    imageShowDiv.style['display'] = 'none';
}